package cpi.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cpi.dao.CollectionDao;
import cpi.entity.Collection;
import cpi.service.CollectionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * (Collection)表服务实现类
 *
 * @author makejava
 * @since 2022-07-18 14:47:29
 */
@Service("collectionService")
public class CollectionServiceImpl extends ServiceImpl<CollectionDao, Collection> implements CollectionService {
    @Resource
    CollectionDao collectionDao;
    @Override
    public List<Map<String, Object>> selectProvince() {
        return collectionDao.selectProvince();
    }

    @Override
    public List<Map<String, Object>> selectType() {
        return collectionDao.selectType();
    }

    @Override
    public List<Map<String, Object>> getByid(int id) {
        return collectionDao.getByid(id);
    }

    @Override
    public boolean collect(String collect_name, String type,String province, int time) {
        return collectionDao.collectProvince(collect_name,type,province,time)>0;
    }

    @Override
    public boolean delete(String type, String province, Integer time) {
        return collectionDao.delete(type,province,time)>0;
    }

    @Override
    public boolean isProvince(String type, int time) {
        return collectionDao.isProvince(type,time)>0;
    }

    @Override
    public boolean isType(String province, int time) {
        return collectionDao.isType(province,time)>0;
    }
}

